package com.cloud.mall.usr.service;


import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.user.input.UmsPermissionInpDTO;
import com.cloud.mall.user.output.UmsPermissionOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Api(tags = "用户权限接口")
@RequestMapping("/permission")
public interface UmsPermissionService {


    @ApiOperation(value = "添加权限")
    @PostMapping("/create")
    BaseResponse create(@RequestBody UmsPermissionInpDTO umsPermissionDTO);

    @ApiOperation("修改后台权限")
    @GetMapping("/update/{id}")
    BaseResponse update(@PathVariable Long id, @RequestBody UmsPermissionInpDTO umsPermissionDTO);

    @ApiOperation("根据id批量删除权限")
    @PostMapping("/delete")
    BaseResponse delete(@RequestParam("ids") List<Long> ids);

    @ApiOperation("以层级结构返回所有权限")
    @GetMapping("/treeList")
    BaseResponse treeList();

    @ApiOperation("获取所有权限列表")
    @GetMapping("/list")
    public BaseResponse<List<UmsPermissionOut>> list();

}
